# encoding=utf8

from flask import Blueprint, render_template
from flask_login import login_required, current_user

from app.forms.device import IndexForm

main = Blueprint('main', __name__)


@main.route('/')
@login_required
def index():
    form = IndexForm(user_id=current_user.id)
    return render_template('main/index.html', devices=form.query_device())


@main.route('/chat')
def chat():
    return render_template('websocket_client.html')
